package com.ptu.entity;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

public class Order {
    private Long id;                // 订单ID
    private Long userId;            // 用户ID
    private String orderNo;         // 订单号
    private BigDecimal totalAmount; // 订单总金额
    private BigDecimal actualAmount; // 实付金额
    private Integer status;         // 订单状态(0待支付 1已支付 2已取消 3已发货 4已完成)
    private String paymentMethod;   // 支付方式
    private Long addressId;         // 收货地址ID
    private String remark;          // 备注
    private Date createTime;        // 创建时间
    private Date updateTime;        // 更新时间
    private Date payTime;           // 支付时间

    private List<OrderItem> orderItems; // 订单明细列表

    public Order() {
    }

    public Order(Long id, Long userId, String orderNo, BigDecimal totalAmount, BigDecimal actualAmount, Integer status, String paymentMethod, Long addressId, String remark, Date createTime, Date updateTime, Date payTime, List<OrderItem> orderItems) {
        this.id = id;
        this.userId = userId;
        this.orderNo = orderNo;
        this.totalAmount = totalAmount;
        this.actualAmount = actualAmount;
        this.status = status;
        this.paymentMethod = paymentMethod;
        this.addressId = addressId;
        this.remark = remark;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.payTime = payTime;
        this.orderItems = orderItems;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public BigDecimal getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(BigDecimal totalAmount) {
        this.totalAmount = totalAmount;
    }

    public BigDecimal getActualAmount() {
        return actualAmount;
    }

    public void setActualAmount(BigDecimal actualAmount) {
        this.actualAmount = actualAmount;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getPaymentMethod() {
        return paymentMethod;
    }

    public void setPaymentMethod(String paymentMethod) {
        this.paymentMethod = paymentMethod;
    }

    public Long getAddressId() {
        return addressId;
    }

    public void setAddressId(Long addressId) {
        this.addressId = addressId;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Date getPayTime() {
        return payTime;
    }

    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }

    public List<OrderItem> getOrderItems() {
        return orderItems;
    }

    public void setOrderItems(List<OrderItem> orderItems) {
        this.orderItems = orderItems;
    }


    @Override
    public String toString() {
        return "Order{" +
                "id=" + id +
                ", userId=" + userId +
                ", orderNo='" + orderNo + '\'' +
                ", totalAmount=" + totalAmount +
                ", actualAmount=" + actualAmount +
                ", status=" + status +
                ", paymentMethod='" + paymentMethod + '\'' +
                ", addressId=" + addressId +
                ", remark='" + remark + '\'' +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", payTime=" + payTime +
                ", orderItems=" + orderItems +
                '}';
    }
}